{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import time\n",
    "os_train=pd.read_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\oc_train.csv')\n",
    "os_test=pd.read_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\oc_test.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 删除没有购买东西的行，只删除test中没有的距离"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "indx=os_train[os_train['Discount_rate']<1].index\n",
    "discount=os_train.loc[indx]\n",
    "os_train=os_train.drop(indx,axis=0)\n",
    "discount.index=np.arange(0,len(discount),1)\n",
    "os_train.index=np.arange(0,len(os_train),1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#初始化\n",
    "a=set(os_train['Merchant_id'].values)\n",
    "s=pd.DataFrame()\n",
    "s['a']=list(a)\n",
    "os_train['shop_id']=0\n",
    "s.to_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\a.csv',index=False)\n",
    "os_train.to_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\os_train_shop.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "ha=pd.read_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\a.csv')\n",
    "ha.index=np.arange(0,len(ha),1)\n",
    "ha['len']=0\n",
    "for i in ha.index:\n",
    "    ha.loc[i,'len']=len(os_train[os_train['Merchant_id']==ha.loc[i,'a']])\n",
    "ha=ha.sort_values(by=['len'],ascending=False).copy()\n",
    "ha.index=np.arange(0,len(ha),1)\n",
    "ha.to_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\a.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def shopn(id):           #计算店铺数量\n",
    "    merid.extend(list(id))\n",
    "    indexs=[]\n",
    "    for mid in id:\n",
    "        indexxx.extend(list(os_train[os_train['Merchant_id']==mid].index))\n",
    "        indexs.extend(list(os_train[os_train['Merchant_id']==mid].index))\n",
    "        #  avg=os_train[os_train['Merchant_id']==mid]['Discount_rate'].mean()\n",
    "\n",
    "        for uid in set(os_train[os_train['Merchant_id']==mid]['User_id'].values):\n",
    "            dis=os_train[(os_train['Merchant_id']==mid)&(os_train['User_id']==uid)]['Distance'].max()\n",
    "            time_min=os_train[(os_train['Merchant_id']==mid)&(os_train['User_id']==uid)]['Date_received'].min()\n",
    "            time_max=os_train[(os_train['Merchant_id']==mid)&(os_train['User_id']==uid)]['Date_received'].max()\n",
    "            merchantid=set()\n",
    "            discount_rate=os_train[(os_train['Merchant_id']==mid)&(os_train['User_id']==uid)]['Discount_rate'].max()\n",
    "            for ind in os_train[(os_train['User_id']==uid)&(os_train['Distance']==int(dis))].index:\n",
    "                if (os_train.loc[ind,'Discount_rate']==discount_rate) or (abs(os_train.loc[ind,'Date_received']-time_min)<7) or (abs(os_train.loc[ind,'Date_received']-time_max)<7):\n",
    "                    if ind not in indexxx and os_train.loc[ind,'Merchant_id'] not in merid:\n",
    "                        merchantid.add(os_train.loc[ind,'Merchant_id'])\n",
    "                    indexxx.extend([ind])\n",
    "                    indexs.extend([ind])\n",
    "#             print('merchantid:',merchantid,end='\\t')\n",
    "            if len(merchantid)!=0:\n",
    "                indexs.extend(shopn(merchantid))\n",
    "                indexxx.extend([ind])\n",
    "    return indexs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "list(a)[0]: 3381 "
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "ha=pd.read_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\a.csv')\n",
    "os_train=pd.read_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\os_train_shop.csv')\n",
    "i=os_train['shop_id'].max()+1\n",
    "# import winsound\n",
    "import time\n",
    "global indexxx, merid\n",
    "indexxx=[]\n",
    "merid=[]\n",
    "while 1:\n",
    "    use=ha.loc[0,'a']\n",
    "    print('list(a)[0]:',use,end=' ')\n",
    "    start=time.time()\n",
    "    index1=shopn([use])\n",
    "    end=time.time()\n",
    "    print('time:',end-start,end=' ')\n",
    "    os_train.loc[list(set(index1)),'shop_id']=i\n",
    "    for ind in set(os_train.loc[list(set(index1)),'Merchant_id'].values):\n",
    "        ha.drop(list(ha[ha['a']==ind].index),axis=0,inplace=True)\n",
    "    print('lenp(ha):',len(ha)/3697,'rate:',(len(os_train)-len(set(indexxx)))/len(os_train),\\\n",
    "          'i:',i,end=' ')\n",
    "#     winsound.Beep(400,600)\n",
    "    i+=1\n",
    "    ha=ha.sort_values(by=['len'],ascending=False).copy()\n",
    "    ha.index=np.arange(0,len(ha),1)\n",
    "    if len(ha)==0:\n",
    "        print('处理完毕！')\n",
    "        break\n",
    "    print('ha.loc[0,\\'a\\']',ha.loc[0,'a'])\n",
    "    indexxx=list(set(indexxx))\n",
    "    merid=list(set(merid))\n",
    "#     ha.to_csv(r'D:\\Data\\TCForNewComer\\deal\\a.csv',index=False)\n",
    "#     os_train.to_csv(r'D:\\Data\\TCForNewComer\\deal\\os_train_shop.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "ha.to_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\a.csv',index=False)\n",
    "os_train.to_csv(r'D:\\Data\\TCForNewComer\\deal\\ALLuserid\\os_train_shop.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>User_id</th>\n",
       "      <th>Merchant_id</th>\n",
       "      <th>Coupon_id</th>\n",
       "      <th>Discount_rate</th>\n",
       "      <th>Distance</th>\n",
       "      <th>Date_received</th>\n",
       "      <th>Date</th>\n",
       "      <th>ord_buy</th>\n",
       "      <th>Coupon_num</th>\n",
       "      <th>Coupon_nouse_num</th>\n",
       "      <th>...</th>\n",
       "      <th>Coupon_lep100</th>\n",
       "      <th>Coupon_grp100</th>\n",
       "      <th>Avg_saler_Coupon</th>\n",
       "      <th>Avg_distance</th>\n",
       "      <th>shop_count</th>\n",
       "      <th>shop_pro</th>\n",
       "      <th>Coupon_diffcount</th>\n",
       "      <th>Coupon_diffpro</th>\n",
       "      <th>same_Coupon_count</th>\n",
       "      <th>shop_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>215</td>\n",
       "      <td>129</td>\n",
       "      <td>8944</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>524</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>316</td>\n",
       "      <td>7974</td>\n",
       "      <td>8952</td>\n",
       "      <td>40.0</td>\n",
       "      <td>0</td>\n",
       "      <td>430</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>417</td>\n",
       "      <td>3381</td>\n",
       "      <td>11951</td>\n",
       "      <td>180.0</td>\n",
       "      <td>0</td>\n",
       "      <td>227</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>417</td>\n",
       "      <td>450</td>\n",
       "      <td>8555</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>203</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>417</td>\n",
       "      <td>6434</td>\n",
       "      <td>10050</td>\n",
       "      <td>45.0</td>\n",
       "      <td>0</td>\n",
       "      <td>227</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>417</td>\n",
       "      <td>3888</td>\n",
       "      <td>11366</td>\n",
       "      <td>40.0</td>\n",
       "      <td>0</td>\n",
       "      <td>227</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>417</td>\n",
       "      <td>775</td>\n",
       "      <td>5435</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0</td>\n",
       "      <td>329</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>432</td>\n",
       "      <td>6424</td>\n",
       "      <td>1315</td>\n",
       "      <td>90.0</td>\n",
       "      <td>1</td>\n",
       "      <td>129</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>432</td>\n",
       "      <td>1041</td>\n",
       "      <td>13490</td>\n",
       "      <td>25.0</td>\n",
       "      <td>2</td>\n",
       "      <td>129</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>432</td>\n",
       "      <td>1569</td>\n",
       "      <td>5054</td>\n",
       "      <td>170.0</td>\n",
       "      <td>4</td>\n",
       "      <td>405</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>448</td>\n",
       "      <td>3381</td>\n",
       "      <td>11951</td>\n",
       "      <td>180.0</td>\n",
       "      <td>1</td>\n",
       "      <td>128</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>448</td>\n",
       "      <td>2709</td>\n",
       "      <td>2840</td>\n",
       "      <td>90.0</td>\n",
       "      <td>1</td>\n",
       "      <td>128</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>448</td>\n",
       "      <td>7555</td>\n",
       "      <td>9871</td>\n",
       "      <td>25.0</td>\n",
       "      <td>2</td>\n",
       "      <td>406</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>448</td>\n",
       "      <td>4833</td>\n",
       "      <td>7802</td>\n",
       "      <td>180.0</td>\n",
       "      <td>8</td>\n",
       "      <td>130</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>448</td>\n",
       "      <td>8077</td>\n",
       "      <td>6680</td>\n",
       "      <td>90.0</td>\n",
       "      <td>10</td>\n",
       "      <td>128</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>448</td>\n",
       "      <td>3381</td>\n",
       "      <td>1807</td>\n",
       "      <td>270.0</td>\n",
       "      <td>1</td>\n",
       "      <td>128</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>452</td>\n",
       "      <td>7605</td>\n",
       "      <td>9787</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0</td>\n",
       "      <td>323</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>452</td>\n",
       "      <td>7921</td>\n",
       "      <td>7730</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>521</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>452</td>\n",
       "      <td>7921</td>\n",
       "      <td>12365</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>521</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>452</td>\n",
       "      <td>7921</td>\n",
       "      <td>8998</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>521</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>470</td>\n",
       "      <td>1892</td>\n",
       "      <td>452</td>\n",
       "      <td>90.0</td>\n",
       "      <td>2</td>\n",
       "      <td>113</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>470</td>\n",
       "      <td>7717</td>\n",
       "      <td>9614</td>\n",
       "      <td>19.0</td>\n",
       "      <td>2</td>\n",
       "      <td>424</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>569</td>\n",
       "      <td>4869</td>\n",
       "      <td>4788</td>\n",
       "      <td>45.0</td>\n",
       "      <td>2</td>\n",
       "      <td>604</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>728</td>\n",
       "      <td>4043</td>\n",
       "      <td>3222</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>518</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>736</td>\n",
       "      <td>450</td>\n",
       "      <td>1532</td>\n",
       "      <td>25.0</td>\n",
       "      <td>5</td>\n",
       "      <td>516</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>736</td>\n",
       "      <td>2709</td>\n",
       "      <td>2840</td>\n",
       "      <td>90.0</td>\n",
       "      <td>2</td>\n",
       "      <td>131</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>766</td>\n",
       "      <td>3630</td>\n",
       "      <td>3690</td>\n",
       "      <td>15.0</td>\n",
       "      <td>2</td>\n",
       "      <td>323</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>766</td>\n",
       "      <td>3630</td>\n",
       "      <td>3690</td>\n",
       "      <td>15.0</td>\n",
       "      <td>2</td>\n",
       "      <td>323</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>878</td>\n",
       "      <td>450</td>\n",
       "      <td>1613</td>\n",
       "      <td>25.0</td>\n",
       "      <td>10</td>\n",
       "      <td>602</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>892</td>\n",
       "      <td>1569</td>\n",
       "      <td>5054</td>\n",
       "      <td>170.0</td>\n",
       "      <td>2</td>\n",
       "      <td>426</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209633</th>\n",
       "      <td>7359538</td>\n",
       "      <td>6885</td>\n",
       "      <td>13616</td>\n",
       "      <td>9.0</td>\n",
       "      <td>10</td>\n",
       "      <td>217</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209634</th>\n",
       "      <td>7359649</td>\n",
       "      <td>450</td>\n",
       "      <td>1532</td>\n",
       "      <td>25.0</td>\n",
       "      <td>1</td>\n",
       "      <td>525</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209635</th>\n",
       "      <td>7359692</td>\n",
       "      <td>2934</td>\n",
       "      <td>5686</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0</td>\n",
       "      <td>325</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209636</th>\n",
       "      <td>7359692</td>\n",
       "      <td>2934</td>\n",
       "      <td>5686</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0</td>\n",
       "      <td>325</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209637</th>\n",
       "      <td>7359699</td>\n",
       "      <td>3939</td>\n",
       "      <td>1110</td>\n",
       "      <td>95.0</td>\n",
       "      <td>0</td>\n",
       "      <td>531</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209638</th>\n",
       "      <td>7359794</td>\n",
       "      <td>2709</td>\n",
       "      <td>13165</td>\n",
       "      <td>90.0</td>\n",
       "      <td>10</td>\n",
       "      <td>509</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209639</th>\n",
       "      <td>7359805</td>\n",
       "      <td>3381</td>\n",
       "      <td>7610</td>\n",
       "      <td>180.0</td>\n",
       "      <td>4</td>\n",
       "      <td>413</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209640</th>\n",
       "      <td>7359809</td>\n",
       "      <td>450</td>\n",
       "      <td>1613</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0</td>\n",
       "      <td>614</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209641</th>\n",
       "      <td>7359809</td>\n",
       "      <td>4748</td>\n",
       "      <td>1130</td>\n",
       "      <td>180.0</td>\n",
       "      <td>3</td>\n",
       "      <td>513</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209642</th>\n",
       "      <td>7359809</td>\n",
       "      <td>4660</td>\n",
       "      <td>1480</td>\n",
       "      <td>90.0</td>\n",
       "      <td>10</td>\n",
       "      <td>125</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209643</th>\n",
       "      <td>7359809</td>\n",
       "      <td>6434</td>\n",
       "      <td>10050</td>\n",
       "      <td>45.0</td>\n",
       "      <td>10</td>\n",
       "      <td>125</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209644</th>\n",
       "      <td>7360071</td>\n",
       "      <td>1469</td>\n",
       "      <td>7430</td>\n",
       "      <td>30.0</td>\n",
       "      <td>3</td>\n",
       "      <td>521</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209645</th>\n",
       "      <td>7360401</td>\n",
       "      <td>4660</td>\n",
       "      <td>1480</td>\n",
       "      <td>90.0</td>\n",
       "      <td>1</td>\n",
       "      <td>127</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209646</th>\n",
       "      <td>7360401</td>\n",
       "      <td>7555</td>\n",
       "      <td>17</td>\n",
       "      <td>25.0</td>\n",
       "      <td>5</td>\n",
       "      <td>127</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209647</th>\n",
       "      <td>7360401</td>\n",
       "      <td>450</td>\n",
       "      <td>1532</td>\n",
       "      <td>25.0</td>\n",
       "      <td>5</td>\n",
       "      <td>522</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209648</th>\n",
       "      <td>7360401</td>\n",
       "      <td>760</td>\n",
       "      <td>2418</td>\n",
       "      <td>25.0</td>\n",
       "      <td>0</td>\n",
       "      <td>605</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209649</th>\n",
       "      <td>7360432</td>\n",
       "      <td>8144</td>\n",
       "      <td>11344</td>\n",
       "      <td>19.0</td>\n",
       "      <td>1</td>\n",
       "      <td>515</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209650</th>\n",
       "      <td>7360556</td>\n",
       "      <td>6434</td>\n",
       "      <td>10050</td>\n",
       "      <td>45.0</td>\n",
       "      <td>10</td>\n",
       "      <td>125</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209651</th>\n",
       "      <td>7360556</td>\n",
       "      <td>4660</td>\n",
       "      <td>1480</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3</td>\n",
       "      <td>125</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209652</th>\n",
       "      <td>7360556</td>\n",
       "      <td>6284</td>\n",
       "      <td>7379</td>\n",
       "      <td>40.0</td>\n",
       "      <td>6</td>\n",
       "      <td>125</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209653</th>\n",
       "      <td>7360651</td>\n",
       "      <td>8856</td>\n",
       "      <td>83</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0</td>\n",
       "      <td>606</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>324</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209654</th>\n",
       "      <td>7360785</td>\n",
       "      <td>6424</td>\n",
       "      <td>1315</td>\n",
       "      <td>90.0</td>\n",
       "      <td>8</td>\n",
       "      <td>131</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209655</th>\n",
       "      <td>7360845</td>\n",
       "      <td>1569</td>\n",
       "      <td>5054</td>\n",
       "      <td>170.0</td>\n",
       "      <td>8</td>\n",
       "      <td>413</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209656</th>\n",
       "      <td>7360845</td>\n",
       "      <td>450</td>\n",
       "      <td>3732</td>\n",
       "      <td>25.0</td>\n",
       "      <td>8</td>\n",
       "      <td>410</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209657</th>\n",
       "      <td>7360845</td>\n",
       "      <td>5341</td>\n",
       "      <td>11539</td>\n",
       "      <td>25.0</td>\n",
       "      <td>8</td>\n",
       "      <td>128</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209658</th>\n",
       "      <td>7360967</td>\n",
       "      <td>6485</td>\n",
       "      <td>10323</td>\n",
       "      <td>15.0</td>\n",
       "      <td>1</td>\n",
       "      <td>322</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209659</th>\n",
       "      <td>7360967</td>\n",
       "      <td>6485</td>\n",
       "      <td>10323</td>\n",
       "      <td>15.0</td>\n",
       "      <td>1</td>\n",
       "      <td>322</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209660</th>\n",
       "      <td>7360967</td>\n",
       "      <td>3103</td>\n",
       "      <td>2375</td>\n",
       "      <td>29.0</td>\n",
       "      <td>2</td>\n",
       "      <td>120</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209661</th>\n",
       "      <td>7360967</td>\n",
       "      <td>3103</td>\n",
       "      <td>2375</td>\n",
       "      <td>29.0</td>\n",
       "      <td>2</td>\n",
       "      <td>110</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>209662</th>\n",
       "      <td>7361024</td>\n",
       "      <td>1433</td>\n",
       "      <td>8735</td>\n",
       "      <td>25.0</td>\n",
       "      <td>10</td>\n",
       "      <td>211</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>209663 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        User_id  Merchant_id  Coupon_id  Discount_rate  Distance  \\\n",
       "0           215          129       8944           25.0         1   \n",
       "1           316         7974       8952           40.0         0   \n",
       "2           417         3381      11951          180.0         0   \n",
       "3           417          450       8555           25.0         1   \n",
       "4           417         6434      10050           45.0         0   \n",
       "5           417         3888      11366           40.0         0   \n",
       "6           417          775       5435           25.0         0   \n",
       "7           432         6424       1315           90.0         1   \n",
       "8           432         1041      13490           25.0         2   \n",
       "9           432         1569       5054          170.0         4   \n",
       "10          448         3381      11951          180.0         1   \n",
       "11          448         2709       2840           90.0         1   \n",
       "12          448         7555       9871           25.0         2   \n",
       "13          448         4833       7802          180.0         8   \n",
       "14          448         8077       6680           90.0        10   \n",
       "15          448         3381       1807          270.0         1   \n",
       "16          452         7605       9787           15.0         0   \n",
       "17          452         7921       7730           25.0         1   \n",
       "18          452         7921      12365           25.0         1   \n",
       "19          452         7921       8998           25.0         1   \n",
       "20          470         1892        452           90.0         2   \n",
       "21          470         7717       9614           19.0         2   \n",
       "22          569         4869       4788           45.0         2   \n",
       "23          728         4043       3222           25.0         1   \n",
       "24          736          450       1532           25.0         5   \n",
       "25          736         2709       2840           90.0         2   \n",
       "26          766         3630       3690           15.0         2   \n",
       "27          766         3630       3690           15.0         2   \n",
       "28          878          450       1613           25.0        10   \n",
       "29          892         1569       5054          170.0         2   \n",
       "...         ...          ...        ...            ...       ...   \n",
       "209633  7359538         6885      13616            9.0        10   \n",
       "209634  7359649          450       1532           25.0         1   \n",
       "209635  7359692         2934       5686           25.0         0   \n",
       "209636  7359692         2934       5686           25.0         0   \n",
       "209637  7359699         3939       1110           95.0         0   \n",
       "209638  7359794         2709      13165           90.0        10   \n",
       "209639  7359805         3381       7610          180.0         4   \n",
       "209640  7359809          450       1613           25.0         0   \n",
       "209641  7359809         4748       1130          180.0         3   \n",
       "209642  7359809         4660       1480           90.0        10   \n",
       "209643  7359809         6434      10050           45.0        10   \n",
       "209644  7360071         1469       7430           30.0         3   \n",
       "209645  7360401         4660       1480           90.0         1   \n",
       "209646  7360401         7555         17           25.0         5   \n",
       "209647  7360401          450       1532           25.0         5   \n",
       "209648  7360401          760       2418           25.0         0   \n",
       "209649  7360432         8144      11344           19.0         1   \n",
       "209650  7360556         6434      10050           45.0        10   \n",
       "209651  7360556         4660       1480           90.0         3   \n",
       "209652  7360556         6284       7379           40.0         6   \n",
       "209653  7360651         8856         83            9.0         0   \n",
       "209654  7360785         6424       1315           90.0         8   \n",
       "209655  7360845         1569       5054          170.0         8   \n",
       "209656  7360845          450       3732           25.0         8   \n",
       "209657  7360845         5341      11539           25.0         8   \n",
       "209658  7360967         6485      10323           15.0         1   \n",
       "209659  7360967         6485      10323           15.0         1   \n",
       "209660  7360967         3103       2375           29.0         2   \n",
       "209661  7360967         3103       2375           29.0         2   \n",
       "209662  7361024         1433       8735           25.0        10   \n",
       "\n",
       "        Date_received  Date  ord_buy  Coupon_num  Coupon_nouse_num   ...     \\\n",
       "0                 524     0        1           1                 1   ...      \n",
       "1                 430     0        0           1                 1   ...      \n",
       "2                 227     0        0           5                 4   ...      \n",
       "3                 203     0        0           5                 4   ...      \n",
       "4                 227     0        0           5                 4   ...      \n",
       "5                 227     0        0           5                 4   ...      \n",
       "6                 329     1        1           5                 4   ...      \n",
       "7                 129     0        0           3                 3   ...      \n",
       "8                 129     0        0           3                 3   ...      \n",
       "9                 405     0        0           3                 3   ...      \n",
       "10                128     0        0           9                 9   ...      \n",
       "11                128     0        0           9                 9   ...      \n",
       "12                406     0        0           9                 9   ...      \n",
       "13                130     0        0           9                 9   ...      \n",
       "14                128     0        0           9                 9   ...      \n",
       "15                128     0        0           9                 9   ...      \n",
       "16                323     0        1           4                 4   ...      \n",
       "17                521     0        1           4                 4   ...      \n",
       "18                521     0        1           4                 4   ...      \n",
       "19                521     0        1           4                 4   ...      \n",
       "20                113     0        1           2                 2   ...      \n",
       "21                424     0        0           2                 2   ...      \n",
       "22                604     0        0           1                 1   ...      \n",
       "23                518     0        0           2                 2   ...      \n",
       "24                516     0        0           2                 2   ...      \n",
       "25                131     0        0           2                 2   ...      \n",
       "26                323     0        1           2                 2   ...      \n",
       "27                323     0        1           2                 2   ...      \n",
       "28                602     0        1           1                 1   ...      \n",
       "29                426     0        0           1                 1   ...      \n",
       "...               ...   ...      ...         ...               ...   ...      \n",
       "209633            217     1        1           3                 2   ...      \n",
       "209634            525     0        0           1                 1   ...      \n",
       "209635            325     0        2           2                 2   ...      \n",
       "209636            325     0        2           2                 2   ...      \n",
       "209637            531     0        0           1                 1   ...      \n",
       "209638            509     0        0           1                 1   ...      \n",
       "209639            413     0        0           1                 1   ...      \n",
       "209640            614     0        0           4                 4   ...      \n",
       "209641            513     0        0           4                 4   ...      \n",
       "209642            125     0        0           4                 4   ...      \n",
       "209643            125     0        0           4                 4   ...      \n",
       "209644            521     0        0           1                 1   ...      \n",
       "209645            127     0        0           4                 4   ...      \n",
       "209646            127     0        0           4                 4   ...      \n",
       "209647            522     0        0           4                 4   ...      \n",
       "209648            605     0        0           4                 4   ...      \n",
       "209649            515     0        1           1                 1   ...      \n",
       "209650            125     0        0           3                 3   ...      \n",
       "209651            125     0        0           3                 3   ...      \n",
       "209652            125     0        0           3                 3   ...      \n",
       "209653            606     0        3           1                 1   ...      \n",
       "209654            131     0        0           1                 1   ...      \n",
       "209655            413     0        0           3                 2   ...      \n",
       "209656            410     0        0           3                 2   ...      \n",
       "209657            128     0        0           3                 2   ...      \n",
       "209658            322     0        0           4                 4   ...      \n",
       "209659            322     0        0           4                 4   ...      \n",
       "209660            120     0        2           4                 4   ...      \n",
       "209661            110     0        2           4                 4   ...      \n",
       "209662            211     0        0           1                 1   ...      \n",
       "\n",
       "        Coupon_lep100  Coupon_grp100  Avg_saler_Coupon  Avg_distance  \\\n",
       "0                 0.0            0.0                 0           0.0   \n",
       "1                 0.0            0.0                 0           0.0   \n",
       "2                 1.0            0.0                 1           0.0   \n",
       "3                 1.0            0.0                 0           0.0   \n",
       "4                 1.0            0.0                 1           0.0   \n",
       "5                 1.0            0.0                 1           0.0   \n",
       "6                 1.0            0.0                 1           0.0   \n",
       "7                 0.0            0.0                 0           0.0   \n",
       "8                 0.0            0.0                 0           0.0   \n",
       "9                 0.0            0.0                 0           0.0   \n",
       "10                0.0            0.0                 0           0.0   \n",
       "11                0.0            0.0                 0           0.0   \n",
       "12                0.0            0.0                 0           0.0   \n",
       "13                0.0            0.0                 0           0.0   \n",
       "14                0.0            0.0                 0           0.0   \n",
       "15                0.0            0.0                 0           0.0   \n",
       "16                0.0            0.0                 0           0.0   \n",
       "17                0.0            0.0                 0           0.0   \n",
       "18                0.0            0.0                 0           0.0   \n",
       "19                0.0            0.0                 0           0.0   \n",
       "20                0.0            0.0                 0           0.0   \n",
       "21                0.0            0.0                 0           0.0   \n",
       "22                0.0            0.0                 0           0.0   \n",
       "23                0.0            0.0                 0           0.0   \n",
       "24                0.0            0.0                 0           0.0   \n",
       "25                0.0            0.0                 0           0.0   \n",
       "26                0.0            0.0                 0           0.0   \n",
       "27                0.0            0.0                 0           0.0   \n",
       "28                0.0            0.0                 0           0.0   \n",
       "29                0.0            0.0                 0           0.0   \n",
       "...               ...            ...               ...           ...   \n",
       "209633            1.0            0.0                 1          10.0   \n",
       "209634            0.0            0.0                 0           0.0   \n",
       "209635            0.0            0.0                 0           0.0   \n",
       "209636            0.0            0.0                 0           0.0   \n",
       "209637            0.0            0.0                 0           0.0   \n",
       "209638            0.0            0.0                 0           0.0   \n",
       "209639            0.0            0.0                 0           0.0   \n",
       "209640            0.0            0.0                 0           0.0   \n",
       "209641            0.0            0.0                 0           0.0   \n",
       "209642            0.0            0.0                 0           0.0   \n",
       "209643            0.0            0.0                 0           0.0   \n",
       "209644            0.0            0.0                 0           0.0   \n",
       "209645            0.0            0.0                 0           0.0   \n",
       "209646            0.0            0.0                 0           0.0   \n",
       "209647            0.0            0.0                 0           0.0   \n",
       "209648            0.0            0.0                 0           0.0   \n",
       "209649            0.0            0.0                 0           0.0   \n",
       "209650            0.0            0.0                 0           0.0   \n",
       "209651            0.0            0.0                 0           0.0   \n",
       "209652            0.0            0.0                 0           0.0   \n",
       "209653            0.0            0.0                 0           0.0   \n",
       "209654            0.0            0.0                 0           0.0   \n",
       "209655            0.0            0.0                 0           0.0   \n",
       "209656            0.0            0.0                 0           0.0   \n",
       "209657            0.0            0.0                 0           0.0   \n",
       "209658            0.0            0.0                 0           0.0   \n",
       "209659            0.0            0.0                 0           0.0   \n",
       "209660            0.0            0.0                 0           0.0   \n",
       "209661            0.0            0.0                 0           0.0   \n",
       "209662            0.0            0.0                 0           0.0   \n",
       "\n",
       "        shop_count  shop_pro  Coupon_diffcount  Coupon_diffpro  \\\n",
       "0                0       0.0                 0             0.0   \n",
       "1                0       0.0                 0             0.0   \n",
       "2                1       1.0                 1             0.0   \n",
       "3                1       0.0                 1             0.0   \n",
       "4                1       1.0                 1             0.0   \n",
       "5                1       1.0                 1             0.0   \n",
       "6                1       1.0                 1             1.0   \n",
       "7                0       0.0                 0             0.0   \n",
       "8                0       0.0                 0             0.0   \n",
       "9                0       0.0                 0             0.0   \n",
       "10               0       0.0                 0             0.0   \n",
       "11               0       0.0                 0             0.0   \n",
       "12               0       0.0                 0             0.0   \n",
       "13               0       0.0                 0             0.0   \n",
       "14               0       0.0                 0             0.0   \n",
       "15               0       0.0                 0             0.0   \n",
       "16               0       0.0                 0             0.0   \n",
       "17               0       0.0                 0             0.0   \n",
       "18               0       0.0                 0             0.0   \n",
       "19               0       0.0                 0             0.0   \n",
       "20               0       0.0                 0             0.0   \n",
       "21               0       0.0                 0             0.0   \n",
       "22               0       0.0                 0             0.0   \n",
       "23               0       0.0                 0             0.0   \n",
       "24               0       0.0                 0             0.0   \n",
       "25               0       0.0                 0             0.0   \n",
       "26               0       0.0                 0             0.0   \n",
       "27               0       0.0                 0             0.0   \n",
       "28               0       0.0                 0             0.0   \n",
       "29               0       0.0                 0             0.0   \n",
       "...            ...       ...               ...             ...   \n",
       "209633           1       1.0                 1             1.0   \n",
       "209634           0       0.0                 0             0.0   \n",
       "209635           0       0.0                 0             0.0   \n",
       "209636           0       0.0                 0             0.0   \n",
       "209637           0       0.0                 0             0.0   \n",
       "209638           0       0.0                 0             0.0   \n",
       "209639           0       0.0                 0             0.0   \n",
       "209640           0       0.0                 0             0.0   \n",
       "209641           0       0.0                 0             0.0   \n",
       "209642           0       0.0                 0             0.0   \n",
       "209643           0       0.0                 0             0.0   \n",
       "209644           0       0.0                 0             0.0   \n",
       "209645           0       0.0                 0             0.0   \n",
       "209646           0       0.0                 0             0.0   \n",
       "209647           0       0.0                 0             0.0   \n",
       "209648           0       0.0                 0             0.0   \n",
       "209649           0       0.0                 0             0.0   \n",
       "209650           0       0.0                 0             0.0   \n",
       "209651           0       0.0                 0             0.0   \n",
       "209652           0       0.0                 0             0.0   \n",
       "209653           0       0.0                 0             0.0   \n",
       "209654           0       0.0                 0             0.0   \n",
       "209655           0       0.0                 0             0.0   \n",
       "209656           0       0.0                 0             0.0   \n",
       "209657           0       0.0                 0             0.0   \n",
       "209658           0       0.0                 0             0.0   \n",
       "209659           0       0.0                 0             0.0   \n",
       "209660           0       0.0                 0             0.0   \n",
       "209661           0       0.0                 0             0.0   \n",
       "209662           0       0.0                 0             0.0   \n",
       "\n",
       "        same_Coupon_count  shop_id  \n",
       "0                       0        1  \n",
       "1                       0        1  \n",
       "2                       1        1  \n",
       "3                       1        1  \n",
       "4                       1        1  \n",
       "5                       1        1  \n",
       "6                       1        1  \n",
       "7                       0        1  \n",
       "8                       0        1  \n",
       "9                       0        1  \n",
       "10                      0        1  \n",
       "11                      0        1  \n",
       "12                      0        1  \n",
       "13                      0        1  \n",
       "14                      0        1  \n",
       "15                      0        1  \n",
       "16                      0        1  \n",
       "17                      0        1  \n",
       "18                      0        1  \n",
       "19                      0        1  \n",
       "20                      0        1  \n",
       "21                      0        1  \n",
       "22                      0        1  \n",
       "23                      0        1  \n",
       "24                      0        1  \n",
       "25                      0        1  \n",
       "26                      0        1  \n",
       "27                      0        1  \n",
       "28                      0        1  \n",
       "29                      0        1  \n",
       "...                   ...      ...  \n",
       "209633                  2        1  \n",
       "209634                  0        1  \n",
       "209635                  0        1  \n",
       "209636                  0        1  \n",
       "209637                  0        1  \n",
       "209638                  0        1  \n",
       "209639                  0        1  \n",
       "209640                  0        1  \n",
       "209641                  0        1  \n",
       "209642                  0        1  \n",
       "209643                  0        1  \n",
       "209644                  0        1  \n",
       "209645                  0        1  \n",
       "209646                  0        1  \n",
       "209647                  0        1  \n",
       "209648                  0        1  \n",
       "209649                  0        1  \n",
       "209650                  0        1  \n",
       "209651                  0        1  \n",
       "209652                  0        1  \n",
       "209653                  0      324  \n",
       "209654                  0        1  \n",
       "209655                  0        1  \n",
       "209656                  0        1  \n",
       "209657                  0        1  \n",
       "209658                  0        1  \n",
       "209659                  0        1  \n",
       "209660                  0       68  \n",
       "209661                  0       68  \n",
       "209662                  0        1  \n",
       "\n",
       "[209663 rows x 24 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os_train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true,
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "global indexxx, merid\n",
    "indexxx=[]\n",
    "merid=[]\n",
    "start=time.time()\n",
    "index1=shopn([450])\n",
    "end=time.time()\n",
    "print('time:',end-start,end=' ')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true,
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "indexxx.sort()\n",
    "indexxx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "len(set(indexxx))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "6324251 in os_train[os_train['Merchant_id']==7555]['User_id'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "os_train[os_train['Merchant_id']==7555]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "merid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
